<{include file="tpl/filter.tpl"}>

<div>
    <a class="pull-right" style="background: #008678; color: #fff; padding: 2px 8px; margin-bottom: 12px; border-radius: 5px;" href="<{PubFunc::buildUrl('/oss/?r=banUser/add')}>">
        <i class="fa fa-plus"></i> 添加账号封禁
    </a>
</div>

<{include file="tpl/grid.tpl"}>
	

<script>
    $(function(){
  
    	$('a[name="untie"]').click(function(){
    		var id = $(this).attr('data-id');
    		if(!id){
    			layer.alert('参数错误', {icon: 2, skin: 'layui-layer-molv'});
    			return false;
    		}
    		layer.confirm('是否要解封？', {
    			btn: ['确定','取消'],
    			skin: 'layui-layer-molv'
    		}, function(){   			
    		    var url = '?r=banUser/untie&g=mango';
    		    $.ajax({
    		    	type : 'POST',
    			    url : url,
				    data : {'id':id,},
				    dataType :'JSON',
				    success : function(res){
					    if(res.status == 1){
                            layer.open({
					    		content: '解封成功'
                                ,btn: ['确定']
                                ,yes: function(index, layero){
                                	window.location.reload();
                                }
                                ,cancel: function(){
                                	window.location.reload();
                                }
                            });

					    }else{
					    	layer.msg('解封失败', {icon: 2,time: 2000});
					    }
				    }
			    });

    		}, function(){

            });
    		
       });   

    });
    

</script>
